import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path:'/accordion',
    name:'accordion',
    component: ()=>import('@/views/accordion')
  },
  {
    path:'/checkGroup',
    name:'checkGroup',
    component: ()=>import('@/views/checkbox-group-page')
  },
  // {
  //   path: '/calendar',
  //   name:'calendar',
  //   component: ()=>import('@/views/calendar')
  // },
  {
    path:'/pdf',
    name:'pdf',
    component: ()=>import('@/views/pdf')
  },
  {
    path:'/echarts',
    name:'echarts',
    component: ()=>import('@/views/chart/index')
  },
  {
    path:'/provide',
    name:'provide',
    component: ()=>import('@/views/provide-inject')
  },
  {
    path:'/computed',
    name:'computed',
    component: () => import('@/views/compute-get-set')
  },
  {
    path:'/self-components',
    name:'self-components',
    component: () => import('@/views/self-components')
  },
  {
    path:'/calendar',
    name:'calendar',
    component: ()=>import('@/views/calendar/index')
  },
  {
    path:'/count-down',
    name:'countDown',
    component: ()=>import('@/views/count-down')
  },
  {
    path:'/drag',
    name:'drag',
    component: ()=>import('@/views/drag/index')
  },
  {
    path:'/drag-demo',
    component: ()=>import('@/views/drag/demo')
  },
  {
    path:'/render',
    name:'render',
    component: ()=>import('@/views/render/index')
  },
  {
    path:'/svg',
    name:'svg',
    component: ()=>import('@/views/svg')
  },
  {
    path:'/circle-loading',
    name:'circle-loading',
    component: ()=>import('@/views/svg/circle-loading')
  },
  {
    path:'/hook',
    name:'hook',
    component: ()=>import('@/views/svg/hook')
  },
  {
    path:'/flip',
    name:'flip',
    component: () => import('@/views/flip/index.vue')
  },
  {
    path: '/slide-parent',
    name: 'slideParent',
    component: () => import('@/views/slide-page/parent.vue'),
    meta: {
      index: 0, //层级
    }
  },
  {
    path: '/slide-child',
    name: 'slideChild',
    component: () => import('@/views/slide-page/child.vue'),
    meta: {
      index: 1
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
